#include<bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
const int mod=998244353,inf=0x3f3f3f3f3f3f3f3f;
const int N=2e5+10,M=2e5+10;
int a[N],h[N],n;
int atk[1<<11],f[1<<11];
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	freopen("xinyue.in","r",stdin);
	freopen("xinyue.out","w",stdout);
	cin >> n >> atk[0];
	for ( int i = 1 ; i <= n ; i++ )
		cin >> a[i] >>h[i];
	for ( int i = 1 ; i < (1<<n) ; i++ )
	{
		f[i]=inf;
		atk[i]=atk[0];
		for ( int j = 1 ; j <= n ; j++ )
		{
			if((1<<j-1)&i)
			{
				atk[i]=max(atk[i],a[j]);
				int lst=i-(1<<j-1);
				f[i]=min(f[i],f[lst]+((h[j]+atk[lst]-1)/atk[lst]-1)*a[j]);
			}
		}
//		cout << f[i] << " ";
	}
//	cout << endl;
	cout << f[(1<<n)-1];
	return 0;
}
/*
4 1
3 2
4 4
5 6
1 6
*/
